package com.bci.internal.engine.bcibpmengine.controller;


import com.bci.internal.engine.bcibpmengine.service.ActivitiDefinitionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * 流程定义控制类
 *
 * @author jzwu
 * @since 2021/4/5 0005
 */
@Api(tags = "通用流程引擎获取文件接口")
@RestController
@RequestMapping("/processDefinition")
public class ActivitiDefinitionController {

    @Resource
    private ActivitiDefinitionService activitiDefinitionService;

    @ApiOperation("获取流程xml文件")
    @GetMapping(value = "/getDefinitionXML")
    public void getDefinitionXML(HttpServletResponse response,
                                 @RequestParam("deploymentId") String deploymentId,
                                 @RequestParam("resourceName") String resourceName) {
        activitiDefinitionService.getDefinitionXML(response, deploymentId, resourceName);
    }
}